<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			//将日期转换为毫秒数
			getCountDown () {
				const startTime = new Date(
					this.houseData.judicialSaleHouse.auctionTime.replace(/-/g, '/')
				).getTime();
				const nowTime = new Date().getTime();
				//计算毫秒差
				const timeLag = startTime - nowTime
				if(timeLag > 0) {
					//将毫秒数进行分割计算天数
					this.day = parseInt((timeLag / (1000 * 60 * 60 * 24)).toString());
					//计算小时数
					this.hour = parseInt(
					 ((timeLag % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)).toString()
					);
					//计算分钟数
					this.minute = parseInt(
					((timeLag % (1000 * 60 * 60)) / (1000 * 60)).toString()
					);
					//计算秒数
					this.second = parseInt(((timeLag % (1000 * 60)) / 1000).toStirng())
				}
			}
			//跳动的倒计时
			countDown() {
				if(this.second - 1 < 0) {
					if(this.minute - 1 < 0){
						if(this.hour - 1 < 0) {
							if(this.day - 1 < 0 ) {
								clearTimeout(this.timeId);
								return;
							} else {
								this.day--;
								this.hour = 23;
								this.minute = 59;
								this.second = 59;
							}
						} else {
							this.hour--;
							this.minute = 59;
							this.second = 59;
						}
					} else {
						this.minute--;
						this.second = 59;
					}
				} else {
					this.second--;
				}
				this.timeId = setTimeout(this.countDown, 1000)
			}
		</script>
	</body>
</html>
